{% extends 'base.html' %}
{% block title %}问题列表{% endblock %}
{% block main_content %}
    <div class="row">
        <form action="" class="navbar-form navbar-right" role="search">
            <div class="input-group">
                <input type="text" class="form-control" name="key" id="key" placeholder="Search主题">
                <div class="input-group-btn">
                    <button type="submit" class="btn btn-default">查找</button>
                </div>
            </div>
        </form>
    </div>
    <div class="row">
        <table class="table table-hover">
            <tr>
                <th>#</th>
                <th>主题</th>
                <th>分类</th>
                <th>用户</th>
                <th>邮箱</th>
                <th>处理状态</th>
                <th>提交时间</th>
                <th>操作</th>
            </tr>
            {% for item in items %}
                <tr>
                    {#    {{loop.index}} 使用     #}
                    <td>{{ loop.index }}</td>
                    <td>{{ item['Subject'] }}</td>
                    <td>{{ item['CategoryName'] }}</td>
                    <td>{{ item.get('UserName') }}</td>
                    <td>{{ item.Email }}</td>
                    <td>
                        {#    {{ 'danger' if item[6] == 0 else 'success'}}            #}
                        <span class="label label-{{ 'danger' if item.State == '0' else 'success' }}">
                    {{ '待处理' if item.State == '0' else '已处理' }}
                </span>
                    </td>
                    {#            时间截取  ？？ #}
                    <td>{{ (item.RelerseTime) }}</td>
                    <td>
                        {#     操作小图标  pencil   trash       <i class="fa fa-search"></i>#}
                        {#                <a href="#" class="btn btn-default btn-xs" title="查看"><i class="fa fa-search"></i></a>  #}
                        <a href="{{ url_for('edit_feedback',id=item.rowid ) }}" class="btn btn-default btn-xs"
                           title="编辑"><i class="fa fa-pencil"></i></a>
                        <a href="{{ url_for('delete_feedback',id=item.rowid ) }}" class="btn btn-default btn-xs"
                           title="删除"><i class="fa fa-trash"></i></a>
                    </td>
                </tr>
            {% endfor %}
        </table>
    </div>
{% endblock %}